package com.hackcloud.shardingjdbc.service;

import com.hackcloud.shardingjdbc.dao.sys.SysConfigRepository;
import com.hackcloud.shardingjdbc.domain.sys.SysConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class SysConfigService {
    @Autowired
    SysConfigRepository sysConfigRepository;

    @Transactional(value = "defaultTransactionManager", rollbackFor = Exception.class)
    public void save() {
        SysConfig sysConfig = new SysConfig();
        sysConfig.setConfigKey("test");
        sysConfig.setConfigValue("是的");
        sysConfigRepository.save(sysConfig);
    }
}
